
var getMimeTypeFromFilename = (filename) => {
    let pos = filename.lastIndexOf(".") + 1;
    let ext = filename.substr(pos).toLowerCase();
    if (ext == "jpg" || ext == "jpeg") {
        return "image/jpeg";
    } else {
        return "image/" + ext;
    }
}

export {
    getMimeTypeFromFilename,
}
